<template>
  <el-dialog
    v-model="receivedData.visible"
    title="提示"
    width="30%"
    :before-close="handleClose"
  >
    <span>这是一段信息{{ receivedData.data.num }}</span>
    <template #footer>
      <span class="dialog-footer">
        <el-button @click="handleClose">取 消</el-button>
        <el-button type="primary" @click="handleClose">确 定</el-button>
      </span>
    </template>
  </el-dialog>
</template>

<script>
import { defineComponent, reactive, toRefs } from 'vue'
export default defineComponent({
  name: 'FormDialog',
  props: {
    params: {
      type: Object,
      required: true
    }
  },
  setup(props) {
    const state = reactive({
      receivedData: props.params
    })
    const methods = {
      handleClose() {
        state.receivedData.visible = false
      }
    }
    return {
      ...toRefs(state),
      ...methods
    }
  }

})
</script>

<style scoped>

</style>
